package me.shurufa.net;

/**
 * 网络请求常量
 *
 * request method:Post
 * request format:json/www-url-encode
 * response format:json
 *
 * generic parameter:token/page
 *
 * @FileName: me.shurufa.net.API.java
 * @author: kHRYSTAL
 * @email: 723526676@qq.com
 * @date: 2016-01-14 11:47
 */
public class API {
  // Debug Server
  // public static final String BASE_URL = "http://test.api.shurufa.me/";
  public static final String BASE_URL = "http://api.test.shurufa.me/";
  public static final String NEW_BASE_URL = "http://api.new.shurufa.me/";
  //public static final String NEW_BASE_URL = "http://new.test.api.shurufa.me/";
  // public static final String BASE_URL = "http://api.shurufa.me/";
  // captcha
  public static final String SEND_CAPTCHA = BASE_URL + "captcha/send";
  public static final String VALIDATE_CAPTCHA = BASE_URL + "captcha/validate";

  // user
  public static final String USER_REGISTER = BASE_URL + "user/register";
  public static final String USER_LOGIN = BASE_URL + "user/login";//没有默认用户名 头像
  public static final String USER_EXIST = BASE_URL + "user/exists";
  public static final String USER_PROFILE = BASE_URL + "user/profile";
  public static final String USER_MODIFY_NICKNAME = BASE_URL + "user/modify/nickname";
  public static final String USER_MODIFY_EMAIL = BASE_URL + "user/modify/email";
  // public static final String USER_MODIFY_PASSWORD = BASE_URL + "user/modifyPassword";
  public static final String USER_MODIFY_PASSWORD = BASE_URL + "user/modify/password";


  public static final String USER_RESET_PASSWORD = BASE_URL + "user/modifyPasswordWithCode";
  public static final String USER_MODIFY_AVATAR = BASE_URL + "user/modify/avatar";//调试无返回值
  public static final String USER_MODIFY_DESCRIPTION = BASE_URL + "user/modifyDescription";
  //upload avatar
  public static final String USER_UPLOAD_IMAGE = "http://image.shurufa.me";

  // comment
  public static final String COMMENT_ADD = BASE_URL + "comment/add";
  //param bookId pageSize page,[bookInfoScrollView has use this api]
  public static final String COMMENT_GET_BY_BOOK = BASE_URL + "comment/getByBookId";
  //param userId pageSzie page,[userInfoScrollView has use this api]
  public static final String COMMENT_GET_BY_USER = BASE_URL + "comment/getByUserId";
  //param userId bookId
  public static final String COMMENT_GET_BY_USER_AND_BOOK = BASE_URL + "comment/getByUserIdAndBookId";
  // digest
  //param bookId,token,page(select) [bookInfoScrollView has use this api]
  public static final String DIGEST_GET_BY_BOOK = BASE_URL + "excerpt/getByBookId";
  public static final String DIGEST_GET_BY_USER = BASE_URL + "excerpt/getByUserId";
  public static final String DIGEST_GET_BY_MENU = BASE_URL + "excerpt/getByMenuId";

  //根据currentID 和
  public static final String FAVOURDIGEST_DIGEST_GET_BY_BOOKID_AND_USERID
          = BASE_URL+"excerpt/getFavoriteExcerptByUserIdAndBookId";
      //param token excerptedBookId
  public static final String MY_DIGEST_GET_BY_BOOK = BASE_URL + "excerpt/getMyExcerptByExcerptedBookId";

  //discover
  public static final String GET_NEW_BOOKS = BASE_URL + "book/getLatest";
  public static final String GET_HOT_USERS = BASE_URL + "user/getHotUsers";


  //bookInfoScrollView
  //param bookId;
  //public static final String GET_BOOK_INFO = BASE_URL + "book/basicInfo";

  public static final String GET_BOOK_DETAIL_INFO = BASE_URL + "book/detailInfo";
  public static final String GET_BOOK_DETAIL_INFO_NEW = BASE_URL + "book/getDetailInfo";



  //Chat
  //token page
  public static final String GET_MY_MESSAGE = BASE_URL + "message/getMyMessages";
  //token message id
  public static final String SET_MY_MESSAGE_HAS_READ = BASE_URL + "message/read";
  //token message id
  public static final String DELETE_MY_MESSAGE = BASE_URL + "message/delete";
  //token
  public static final String GET_MY_MESSAGE_COUNT = BASE_URL + "message/countNew";

  //Search
  // public static final String SEARCH_BOOK_BY_KEYWORD = BASE_URL + "book/searchByKeyword";
  // public static final String SEARCH_BOOK_BY_ISBN = BASE_URL + "book/getBasicInfoByIsbn";

  //GET FROM SHELVES
  //params userId page withTotal [notice: withTotal and page is selection]
  //点击我收藏的书摘跳转
  public static final String GET_FAVOURITE_BOOK_BY_USER = BASE_URL + "book/getFavoriteBookByUserId";


  //GET FROM FAVOURITE DIGEST OF BOOK
  public static final String GET_FAVOURITE_DIGEST_OF_BOOK_BY_USER = BASE_URL + "book/getFavoriteExcerptedBookByUserId";



  //menu
  //params userId bookId withExcerptTotal
  //withExcerptTotal and userId is selection
  //when withExcerptTotal is 1 userId can use
  //return all digest number or user's digest number for this book
  //public static final String GET_BOOK_MENU = BASE_URL + "book/getMenu";

  //get digests by menuid
  //params menuId token
  //showFavoriteInfo：可选。是否获取相关收藏信息
  //page：可选。
  public static final String GET_DIGEST_BY_MENUID = BASE_URL + "excerpt/getByMenuId";

  //get my digests by menuid
  //params token menuId page
  public static final String GET_MY_DIGEST_BY_MENUID = BASE_URL + "excerpt/getMyExcerptByMenuId";

  //params
  //userId
  //page withTotal 统计个数[selection]
  public static final String GET_DIGEST_BOOK_BY_USERID = BASE_URL + "book/getExcerptedBookByUserId";

  public static final String GET_DIGEST_BY_USERID_AND_MENUID = BASE_URL + "excerpt/getByUserIdAndMenuId";


  //params token(currentUser.token) excerptId(digest.id)
  public static final String FAVOURITE_DIGEST = BASE_URL + "excerpt/favorite";
  public static final String UNFAVOURITE_DIGEST = BASE_URL + "excerpt/deleteFavorite";

  //book
  // public static final String ADD_BOOK_TO_SHELVES = BASE_URL + "book/addMyExcerptedBook";
  public static final String DELETE_BOOK_TO_SHELVES = BASE_URL + "book/deleteMyExcerptedBook";

  //feedback
  public static final String FEEDBACK = BASE_URL + "feedback/add";

  //ocr
  public static final String READ_TEXT_FROM_IMAGE = BASE_URL + "ocr/readTextFromImage";

  //add
  //params bookId content token type: book|excerpt
  public static final String ADD_COMMENT_FOR_BOOK = BASE_URL + "comment/add";
  public static final String ADD_DIGEST = BASE_URL + "excerpt/add";
  public static final String ADD_MENU = BASE_URL + "book/addMenu";


  //modify
  //param token excerptId content note publishState
  // public static final String MODIFY_DIGEST = BASE_URL + "excerpt/modify";
  //remove
  public static final String REMOVE_DIGEST = BASE_URL + "excerpt/delete";
  public static final String GET_MY_BOOKSHELVES_OF_BOOKS = BASE_URL + "book/getExcerptedBookByUserId";


  // App2.0新增加的接口

  // 最新添加
  public static final String GET_RECENT_DIGEST = BASE_URL + "bookstat/getRecentExcerpt";

  // 最多评论
  public static final String GET_TOP_COMMENT = BASE_URL + "bookstat/getTopComment";

  // 最多书摘
  public static final String GET_TOP_DIGEST = BASE_URL + "bookstat/getTopExcerpt";

  // 我的书架
  public static final String GET_MY_SHELF = BASE_URL + "bookstat/getMyRecentExcerpt";

  // 我的评论
  public static final String GET_MY_COMMENT = BASE_URL + "bookstat/getMyRecentComment";

  // 我的收藏
  public static final String GET_MY_FAVORITE = BASE_URL + "bookstat/getMyRecentFavorite";

  // 按时间排序的书摘列表
  public static final String GET_RECENT_OF_BOOK = BASE_URL + "excerpt/getRecentOfBookWithComments";

  // 按最赞排序的书摘列表
  public static final String GET_MOST_PRISE_DIGEST = BASE_URL + "excerpt/getTopPlusOneOfBookWithComments";

  // 根据书id获取指定用户发布的最赞的书摘
  public static final String GET_MOST_PRISE_DIGEST_BY_USER = BASE_URL + "excerpt/getTopPlusOneOfBookFilterByUserWithComments";

  // 按页码排序的书摘列表
  public static final String GET_PAGE_ORDERED_OF_BOOK = BASE_URL + "excerpt/getPageOrderdOfBookWithComments";

  // 根据书id获取根据页码排序的书摘
  public static final String GET_PAGE_ORDERED_OF_BOOK_BY_USER = BASE_URL + "excerpt/getPageOrderdOfBookFilterByUserWithComments";

  // 按章节排序的书摘列表
  public static final String GET_PAGE_CHAPTER_BOOK = BASE_URL + "excerpt/getMenuOrderdOfBookWithComments";

  // 根据书id获取指定用户发布的根据章节排序的书摘
  public static final String GET_PAGE_CHAPTER_BOOK_BY_USER = BASE_URL + "excerpt/getMenuOrderdOfBookFilterByUserWithComments";

  // 我的书摘列表
  public static final String GET_PAGE_DIGEST_ME = BASE_URL + "excerpt/getMineOfBookWithComments";

  // ==== 书评 ====

  // 根据书籍ID获取最赞的评论
  public static final String GET_PRAISE_BOOK_COMMENT = BASE_URL +  "comment/getTopPlusOneOfBookWithSubComments";

  // 获取某用户对某本书的评论（赞数排序）
  public static final String GET_PRAISE_BOOK_COMMENT_BY_USER = BASE_URL +  "comment/getTopPlusOneOfBookFilterByUserWithSubComments";

  // 获取某用户对某本书的评论 (时间排序)
  public static final String GET_RECENT_BOOK_COMMENT_BY_USER = BASE_URL + "comment/getUserOfBookWithSubComments";

  // 根据书籍ID获取最近的评论
  public static final String GET_RECENT_OF_BOOK_COMMENT = BASE_URL +  "comment/getRecentOfBookWithSubComments";

  // 根据自己对书的评论
  public static final String GET_SELF_BOOK_COMMENT = BASE_URL +  "comment/getMineOfBookWithSubComments";

  // 发布对书的评论
  public static final String SEND_BOOK_COMMENT = BASE_URL +  "comment/createOn/book";

  // 发布对书摘的评论
  public static final String SEND_DIGEST_COMMENT = BASE_URL +  "comment/createOn/excerpt";

  // 回复评论
  //public static final String REPLY_COMMENT = BASE_URL +  "comment/reply";

  // searchByKeyword
  public static final String SEARCH_BOOK_BY_KEYWORD = BASE_URL + "book/listBasicInfoByKeyword";

  // searchByKeyword for主界面搜索，返回数据格式与发现模块一致
  public static final String SEARCH_BOOK_BY_KEYWORD_FOR_MAIN = BASE_URL + "bookstat/getByKeyword";

  // isbn
  public static final String SEARCH_BOOK_BY_ISBN = BASE_URL + "book/getBasicInfoByIsbn";

  // 用户书摘本的列表
  public static final String GET_DIGEST_BOOKS = BASE_URL + "notebook/getByUserId";

  // 创建书摘
  public static final String CREATE_DIGEST = BASE_URL + "excerpt/create";

  // 创建书摘本
  public static final String ADD_BOOK_TO_SHELVES = BASE_URL + "notebook/create";

  // 书摘点赞
  public static final String DIGEST_PRAISE = BASE_URL + "plusone/createOn/excerpt";

  // 书摘取消点赞
  public static final String DIGEST_CANCEL_PRAISE = BASE_URL + "plusone/cancel/excerpt";

  // 书摘收藏
  public static final String DIGEST_COLLECT = BASE_URL + "favorite/createOn/excerpt";

  // 书摘取消收藏
  public static final String DIGEST_CANCEL_COLLECT = BASE_URL + "favorite/cancel/excerpt";

  // 书评点赞
  public static final String COMMENT_PRAISE = BASE_URL + "plusone/createOn/comment";

  // 书评取消点赞
  public static final String COMMENT_CANCEL_PRAISE = BASE_URL + "plusone/cancel/comment";

  // 书评收藏
  public static final String COMMENT_COLLECT = BASE_URL + "favorite/createOn/comment";

  // 书评取消收藏
  public static final String COMMENT_CANCEL_COLLECT = BASE_URL + "favorite/cancel/comment";

  // 删除书评/普通评论
  public static final String DELETE_COMMENT = BASE_URL + "comment/delete";

  // 编辑书评
  public static final String MODIFY_COMMENT = BASE_URL + "comment/edit";

  // 删除书摘
  public static final String DELETE_DIGEST = BASE_URL + "excerpt/delete";

  // 编辑书摘
  public static final String MODIFY_DIGEST = BASE_URL + "excerpt/edit";

  // 获得某用户最近书摘列表，一本书一条
  public static final String GET_USER_RECENT_DIGEST = BASE_URL + "recent/getUserPublishedExcerpt";

  // 获得某用户最近书评列表，一本书一条
  public static final String GET_USER_RECENT_COMMENT = BASE_URL + "recent/getUserRecentComment";

  // 通知消息 书摘详情
  public static final String GET_NOTICE_INFO_DIGEST = NEW_BASE_URL + "excerpt/getExcerptInfo";

  // 通知消息 书评详情
  public static final String GET_NOTICE_INFO_BOOKCOMMENT = NEW_BASE_URL + "comment/getCommentInfo";

  // 获得某用户发布的某书的所有书摘
  public static final String GET_USER_PUBLISHED_OF_BOOK = BASE_URL + "excerpt/getUserPublishedOfBookWithComments";

  // 获得某用户发布的某书的所有书评
  public static final String GET_USER_PUBLISHED_COMMENT = BASE_URL + "comment/getUserPublished";

  // 根据bookId, userId获得某用户在某本书中所有收藏的书摘列表
  public static final String GET_COLLECT_DIGEST_BY_USER_BOOK = BASE_URL + "excerpt/getUserFavoriteOfBookWithComments";

  // 根据bookId, userId获得某用户在某本书中所有收藏的书评列表
  public static final String GET_COLLECT_BOOKCOMMENT_BY_USER_BOOK = BASE_URL + "comment/getUserFavoriteBookCommentOfBookWithSubComments";



  // ================开启新世界 德玛西亚在召唤==================
  /**
   * 登录 包含站内登录和第三方登录
   */
  public static final String LOGIN = NEW_BASE_URL + "user/login";

  /**
   * 第三方账号绑定用户名 注册
   */
  public static final String AUTH_REG = NEW_BASE_URL + "user/auth_reg";

  /**
   * 注册
   */
  public static final String REGISTER = NEW_BASE_URL + "user/register";

  /**
   * 获取验证码
   */
  public static final String GET_CAPTCHA = NEW_BASE_URL + "user/send_msg";

  /**
   * 修改密码
   */
  public static final String RESET_PWD = NEW_BASE_URL + "user/up_password";

  /**
   * 修改头像
   */
  public static final String UP_AVATAR = NEW_BASE_URL + "user/up_avatar";

  /**
   * 获取用户信息
   */
  public static final String GET_PROFILE = NEW_BASE_URL + "user/profile";

  /**
   * 最新书列表
   */
  public static final String GET_TOP_BOOK = NEW_BASE_URL + "book/get_top_book";

  /**
   * 最多书摘列表
   */
  public static final String GET_BOOK_MOST_EXCERPT = NEW_BASE_URL + "book/get_more_excerpt_book";

  /**
   * 最多书评列表
   */
  public static final String GET_BOOK_MOST_COMMENT = NEW_BASE_URL + "book/get_more_comment_book";

  /**
   * 我的书架列表
   */
  public static final String GET_MY_SHELF_LIST = NEW_BASE_URL + "member/get_user_bookshelf";

  /**
   * 我的收藏列表
   */
  public static final String GET_MY_COLLECT_LIST = NEW_BASE_URL + "member/get_user_fav";

  /**
   * 最多书评列表
   */
  public static final String GET_MY_COMMENT_LIST = NEW_BASE_URL + "member/get_user_book_comment";

  /**
   * 书详情里的书摘列表
   */
  public static final String GET_EXCERPT_LIST = NEW_BASE_URL + "excerpt/get_excerpt_by_book";

  /**
   * 书详情里的书摘列表(指定用户的)
   */
  public static final String GET_EXCERPT_LIST_BY_USER = NEW_BASE_URL + "excerpt/get_excerpt_by_book_user";

  /**
   * 发布评论(书摘的评论 或者 书评)
   */
  public static final String SEND_COMMENT = NEW_BASE_URL + "comment/create";

  /**
   * 回复评论
   */
  public static final String REPLY = NEW_BASE_URL + "comment/reply";

  /**
   * 书详情
   */
  public static final String GET_BOOK_INFO = NEW_BASE_URL + "book/get_book_info";

  /**
   * 书目录
   */
  public static final String GET_BOOK_MENU = NEW_BASE_URL + "book/get_book_menu";

  /**
   * 根据书id获取用户书摘本 （如果没有就获取最新一条）
   */
  public static final String GET_EXCERPT_BOOK_NEWEST = NEW_BASE_URL + "excerpt/get_bookshelf_by_book";

  /**
   * 创建书斋
   */
  public static final String CREATE_NEW_EXCERPT = NEW_BASE_URL + "excerpt/create";

  /**
   * 编辑书摘
   */
  public static final String EDIT_EXCERPT = NEW_BASE_URL + "excerpt/edit";

  /**
   * 上传图片
   */
  public static final String UPLOAD_IMAGE = NEW_BASE_URL + "excerpt/upload_image";

  /**
   * 书评列表
   */
  public static final String GET_BOOK_COMMENT_LIST = NEW_BASE_URL + "comment/get_comment_by_book_id";

  /**
   * 收藏
   */
  public static final String ADD_FAV = NEW_BASE_URL + "member/add_fav";

  /**
   * 取消收藏
   */
  public static final String DEL_FAV = NEW_BASE_URL + "member/del_fav";

  /**
   * 点赞
   */
  public static final String ADD_ZAN = NEW_BASE_URL + "member/add_zan";

  /**
   * 取消点赞
   */
  public static final String DEL_ZAN = NEW_BASE_URL + "member/del_zan";

  /**
   * 发布评论
   */
  public static final String CREATE_BOOK_COMMENT = NEW_BASE_URL + "comment/create";

  /**
   * 编辑评论
   */
  public static final String EDIT_BOOK_COMMENT = NEW_BASE_URL + "comment/edit";

  /**
   * 删除评论
   */
  public static final String DEL_BOOK_COMMENT = NEW_BASE_URL + "comment/del";

  /**
   * 回复评论
   */
  public static final String REPLY_COMMENT = NEW_BASE_URL + "comment/reply";

  /**
   * 发布评论
   */
  public static final String CREATE_COMMENT = NEW_BASE_URL + "comment/create";

  /**
   * 书评的 评论页
   */
  public static final String GET_BOOKCOMMENT_COMMENTS = NEW_BASE_URL + "comment/get_comment_info";

  /**
   * 书摘的 评论页
   */
  public static final String GET_EXCERPT_COMMENTS = NEW_BASE_URL + "excerpt/get_excerpt_info";

  /**
   * 检查未读消息
   */
  public static final String GET_UNREAD_MESSAGE = NEW_BASE_URL + "message/get_notice_num";

  /**
   * 消息列表接口
   */
  public static final String GET_NOTICE_LIST = NEW_BASE_URL + "message/get_notice_list";

  /**
   * 消息详情
   */
  public static final String GET_NOTICE_INFO = NEW_BASE_URL + "message/get_notice_info";

  /**
   * 他人主页 书评列表
   */
  public static final String GET_USER_BOOK_COMMENT_LIST = NEW_BASE_URL + "member/get_user_book_comment";

  /**
   * 他人主页 书摘列表
   */
  public static final String GET_USER_EXCERPT_LIST = NEW_BASE_URL + "member/get_user_bookshelf";

  /**
   * 图片识别
   */
  public static final String IDENTIFY_IMAGE_TO_TEXT = NEW_BASE_URL + "excerpt/image_text";

  /**
   * 删除我的书摘
   */
  public static final String DEL_EXCERPT = NEW_BASE_URL + "excerpt/del";

  /**
   * 获得消息数量
   */
  public static final String GET_NOTICE_NUM = NEW_BASE_URL + "message/get_notice_num";

  /**
   * 检查更新
   */
  public static final String CHECK_UPDATE = NEW_BASE_URL + "common/version";

  /**
   * 提交建议
   */
  public static final String SUBMIT_SUGGEST = NEW_BASE_URL + "common/suggest";

  /**
   * 需要目录
   */
  public static final String NEED_CATELOG = NEW_BASE_URL + "common/menu_log";

  /**
   * 某本书里用户收藏的书摘
   */
  public static final String GET_FAV_EXCERPT_BY_BOOK_USER = NEW_BASE_URL + "member/get_fav_excerpt_by_book_user";

  /**
   * 某本书里用户收藏的书评
   */
  public static final String GET_FAV_COMMENT_BY_BOOK_USER = NEW_BASE_URL + "member/get_fav_comment_by_book_user";

  /**
   * 用户的书摘本列表
   */
  public static final String GET_NOTEBOOK_BY_USER = NEW_BASE_URL + "excerpt/get_notebook_by_user";

  /**
   * 豆瓣搜书
   */
  public static final String SEARCH_BOOK_BY_DOUBAN = "http://api.douban.com/v2/book/search?q=%s&count=%d&start=%d";

  /**
   * 豆瓣根据ISBN搜索
   */
  public static final String SEARCH_BOOK_BY_ISBN_DOUBAN = "http://api.douban.com/v2/book/isbn/%s";

  /**
   * 根据isbn 获取数据
   */
  public static final String GET_BOOK_BY_ISBN = NEW_BASE_URL + "book/get_book_by_isbn";

  /**
   * 异步提交搜索的数据
   */
  public static final String ASYNC_SUBMIT_JSON_TO_SERVER = NEW_BASE_URL + "book/add_json_book";

  /**
   * 添加书到我的书架
   */
  public static final String ADD_BOOK_TO_SHELF = NEW_BASE_URL + "excerpt/create_note";

  /**
   * 修改用户名
   */
  public static final String UP_USERNAME = NEW_BASE_URL + "user/up_username";

  /**
   * 某人在某本书中的书评列表
   */
  public static final String GET_COMMENT_LIST_BY_BOOKID_USERID = NEW_BASE_URL + "comment/get_comment_by_book_id_user_id";

  /**
   * 初始化数据接口
   */
  public static final String STAT = NEW_BASE_URL + "common/stat";

}
